package tt.com.business.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import tt.com.business.mapper.CommonServeProvidersMapper;
import tt.com.business.service.CommonServeProvidersService;
import tt.com.common.model.YxCommonServeProviders;

import java.math.BigDecimal;
import java.util.List;

@Service
public class CommonServeProvidersServicelmpl extends ServiceImpl<CommonServeProvidersMapper, YxCommonServeProviders> implements CommonServeProvidersService {


    @Override
    public ResponseEntity selectServiceId(String serviceId) {
        QueryWrapper<YxCommonServeProviders> wrapper = new QueryWrapper<>();
        wrapper.eq("serve_type_id",serviceId);
        List<YxCommonServeProviders> yxCommonServeProviders = baseMapper.selectList(wrapper);
        return new ResponseEntity(yxCommonServeProviders , HttpStatus.OK);
    }

    //根据id查询价格
    @Override
    public BigDecimal selectPrice(String id) {
        BigDecimal bigDecimal = baseMapper.selectPrice(id);
        return bigDecimal;
    }
}
